<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入VUE-->
    <script type="text/javascript" src="../js/vue.js"></script>
    <style>
        * {
            padding: 10px 0;
            /* border: 1px solid red; */
        }

        .basic {

            background-color: royalblue;
            height: 200px;
            width: 20%;
        }

        .normal {
            background-color: skyblue;
        }

        .happy {
            background-color: skyblue;
        }

        .style1 {
            border-radius: 25px;
        }
        .style2 {
            color: blueviolet;
            font-weight: 14px;
        }
    </style>
</head>

<body>
    <div id="root">
        <h2>欢迎来到 {{ name }}</h2>
        <!-- 字符串样式 -->
        <div class="basic" :class='bindingClass'>test</div>
        <!-- 样式数组 -->
        <div class="basic" :class='bindingClassArr'>test</div>
    </div>
</body>
<script>
    Vue.config.productionTip = false

    const vm = new Vue({
        el: '#root',
        data: {
            name: '尚硅谷',
            bindingClass: 'happy',
            bindingClassArr: [
                'style1',
                'style2'
            ]
        },
    })
</script>

</html>